import request from '@/utils/request'

//新增帖子信息
export function addTopic(data) {
	return request({
		'url': '/topic/information',
		'method': 'post',
		'data': data
	})
}

//修改帖子信息
export function updateTopic(data) {
	return request({
		'url': '/topic/information/update',
		'method': 'put',
		'data': data
	})
}
// 查询帖子列表
export function getTopic(query) {
	return request({
		url: '/topic/information/AppList',
		method: 'get',
		params: query
	})
}
// 查询帖子列表
export function getMyTopic(query) {
	return request({
		url: '/topic/information/AppMyList',
		method: 'get',
		params: query
	})
}
//喜欢和不喜欢
export function likeEdit(topicId, userId, status, type) {
	return request({
		'url': '/topic/information/' + topicId + "/" + userId + "/" + status + "/" + type,
		'method': 'put',
	})
}
//阅读
export function readEdit(topicId) {
	return request({
		'url': '/topic/information/read/' + topicId,
		'method': 'put',
	})
}
